 interface LoginRequest {
  name: string;
  password: string;
}

 interface Response {
  code: number;
  msg: string;
  data: any;
}

export function useApi() {
  const request = useRequest();

  const login: (data: LoginRequest) => Promise<Response> = (
    data: LoginRequest
  ) => request.post("/login", data);

  return {
    login,
  };
}
